/**
 * @file 工单操作-推送开票
 * @author yangjiangming <449654337@qq.com>
 * @date 2018-12-10 20:13:16
 */
layui.extend({
    oms_work_modify_route: 'work/modify/common/zmn.modify.route'
}).define(['list_modify_common', 'oms_work_modify_route', 'form', '$http'], function (exports) {
    var form = layui.form;
    var $http = layui.$http;
    const route = layui.oms_work_modify_route;
    var opCommonUtils = layui.list_modify_common;

    function initPage() {

    }
    function initEvent() {
        //保存
        form.on('submit(save)', function (data) {

            var dto = {
                workId: data.field.workId,
                orderId: data.field.orderId
            };
            $http.lockSave(data.form.action, dto, data.elem).then(function () {
                layer.msg('操作成功', { icon: 1, time: 1000 }, function () {
                    opCommonUtils.goOperateHome();
                });
            }, (msg) => {
                layer.msg(msg);
            });
            return false
        });
        //取消
        form.on('submit(cancel)', function (data) {
            opCommonUtils.goOperateHome();
            return false
        });
    }

    // 程序入口
    function init() {
        initPage();
        initEvent();
    }

    // 初始化
    init();

    exports('oms_work_modify_invoice_remind');
});
